home *** CD-ROM | disk | FTP | other *** search
- #login.cmd script for Crossroads
- #Author: rdc@netcom.duke.edu
- $rev_date = "7/6/95"
- #Version 1.1
- #
- #This script has been completely rewritten.
- #It now contains descriptive error messages that
- #should help us determine just where the problems
- #are. It should also be much more robust. (yeah, sure!)
- #
- #This script now loops when a busy signal is detected,
- #and will loop for the value of %busyout times. Default
- #is 100. If you wish to change it, simply make it
- #whatever you like. %busyout is in the #DEFINE DEBUGGING AND ECHO STATUS
- #section below.
- #
- #The script will now loop through invalid logins/passwords.
- #It takes a few seconds to reset, so please be patient!
- #
- #If you have been having problems with the old script,
- #this one should fix most of them...and will give you a
- #much more detailed error message to give us!
- #We found some modems that returned different connect
- #strings and this is what was giving the script indigestion!
- #Some modems return CONNECT, some CARRIER, some CONNECTED...sigh
- #This is the reason for the "Connect String ==>" display, so
- #that if there are any MORE versions of connect strings we
- #will know how to hack the script.
- #
- #Some folks have been having problems with error correction
- #and V.42 enabled. To turn 'em off, just set the Error_V42 =
- #line to 1...as in Error_V42 = 1
- #To renable, set it to 0.
- #You can find this variable in the DEFINE DEBUGGING AND ECHO STATUS section.
- #
- #We hope that this new script solves most of the
- #strangeness that has been going on, but realize that
- #there are always little nasty critters lurking about...
- #So, please send email to support@xroads.com with
- #detailed descriptions of your error messages, type of
- #hardware, and anything else you can think of that might
- #be useful.
- #
- #Thanks, and HAPPY SLIPPING!
- #
- #
- #DEFINE DEBUGGING AND ECHO STATUS
- trace off
- #
- # set up some strings for dialling up
- #
- if ![load $number]
- if [query $number "Enter your dial up phone number"]
- save $number
- end
- end
- load $username
- if $username = "Put_your_PPP_login_here"
- display "login name not set up. Please run SETUP.CMD from the DIALER menu"\n
- abort
- end
- if ![load $password]
- if [password "Enter your PPP login password"]
- save $password
- end
- end
- echo off
- trace off
- %Error_V42 = 0
- %connect_status = 0
- $resetstring = "ATZ"
- $CDstring = "AT&C1"
- $userprompt = "ogin:"
- $passprompt = "assword:"
- $addrtarg = "(204.96.10.11) to"
- %busyout = 100
- #
- #ERROR MESSAGES ARE DEFINED HERE
- #
- #exec "notepad.exe ds-wmess.txt"
- $ERROR_DETECT = "Sequence ERROR! Error Message: "
- $no_modem_mess = "LACK OF MODEM RESPONSE!"
- $no_modem_mess2 = "Please ensure your com port and modem are working"
- $no_modem_mess3 = "correctly and try again. We're not able to provide"
- $no_modem_mess4 = "local hardware support! Sorry..."
- $no_carrier_mess = "CARRIER LOST!"
- $no_connect_mess = "CONNECT FAILURE!"
- $mail_us_mess = "Please note the ERROR message and email it to:"
- $mail_us_mess2 = "This will help us immensely. Thanks!"
- $mail_us_mess3 = "along with a description of your hardware."
- $email_mess = "support@xroads.com "
- #
- #
- #BEGIN EXECUTION HERE...
- #
- #
- display \n\n
- display "[Crossroads Terminal Server PPP Script v1.0]"\n
- display "[Current Revision Date:"$rev_date"]"\n
- display "[ExecSequence StartUp.]"\n
- display "[Seq1 -- Initializing your modem...]"\n
- output $resetstring\r
- %timeout = [input 5 OK\n]
- #
- #look for no response from modem
- #
- if !%timeout
- display \n$ERROR_DETECT
- display $no_modem_mess\n\n
- display $no_modem_mess2\n\n
- display $no_modem_mess3\n\n
- display $no_modem_mess4\n\n
- abort
- end
- #
- #Fix carrier detect
- output $CDstring\r
- %timeout = [input 5 OK\n]
-
- if !%timeout
- display \n$ERROR_DETECT
- display $no_modem_mess\n\n
- display $no_modem_mess2\n\n
- display $no_modem_mess3\n\n
- display $no_modem_mess4\n\n
- abort
- end
- display "[Modem initialized OK...]"\n
- #check for no error correction or V.42
- if %Error_V42
- display "[Disable Error/V42 bit set...Disabling V.42 and DataComp!]"\n
- outputecho 10 at s46=136\r
- %return = [read 5 $return]
- if $return <> "OK"
- display "[MODEM FAILURE --- ABORTING]"\n
- abort
- end
- display "[ --- Turned Data Compression Off OK --- ]"\n
- outputecho 10 at s48=128\r
- %return = [read 5 $return]
- if $return <> "OK"
- display "[MODEM FAILURE --- ABORTING]"\n
- abort
- end
- display "[ --- Turned V.42 Off OK --- ]"\n
- end
-
- display "[Seq2 -- Dialing Crossroads at "$number"]"\n
- #
- #modem initialized OK, so begin dialing loop
- #
- %attempts = 0
- repeat
- %attempts = %attempts + 1
- display " [Dialing Attempt: "%attempts"]"\n
- sleep 5
- outputecho 60 atdt $number\r
- %c3 = [read 90 $status]
- display "[Return Status ==> "$status"]"\n
- if $status = "NO DIALTONE"
- display "No Dialtone! Please check your phone line connection"\n
- display "and try again!"\n
- abort
- end
- until $status <> "BUSY" | %attempts = %busyout
- #
- #too many busy signals...give up!
- #
- if %attempts = %busyout
- display \n"Sorry, but I still could't get through after" %busyout "trys!"\n
- display "Please email support@xroads.com and ask the nice"\n
- display "folks to add some more modems! Thanks. Please try again."\n
- sleep 10
- abort
- end
- #
- #OK, got through, now lets see if we synch up..
-
-
- $HOOK_MESSAGE = copy ($status, 1, 3)
- display "[Connect String ==> "$HOOK_MESSAGE"]"\n
-
- if $HOOK_MESSAGE = "CON"
- %connect_status = 1
- end
-
- if $HOOK_MESSAGE = "CAR"
- %connect_status = 1
- end
-
- if !%connect_status
- display \n$ERROR_DETECT
- display $no_connect_mess\n\n
- display $mail_us_mess \n$email_mess$mail_us_mess3\n
- display $mail_us_mess2\n
- abort
- end
-
- display "[Seq3 -- CONNECT OK...]"\n
- #
- # wait till it's safe to send because some modem's hang up
- # if you transmit during the connection phase
- #
- if [wait 10 dcd]
- display "[Seq4 -- Carrier Detected...]"\n
- else
- display "Carrier not detected. Please consult your modem manual and set it"\n
- display "So that DCD follows the carrier signal"\n
- abort
- end
- #
- # now prod the terminal server
- #
- output \13
- #
- #loop through until you get your username and password right
- #
- display "[Seq6 -- Checking your Username and Password...]"\n
- #
- repeat
- echo on
- sleep 1
- input 30 $userprompt
- output $username\13
- input 30 $passprompt
- output $password\13
- echo off
- %good2go = [input 10 PPP session from]
- if !%good2go
- display "Invalid Username or Password...Trying again."\n
- end
- until %good2go
- #
- #you got it...
- #now get your address
- #
- #
- #input 30 $addrtarg
- #input 30 \n
- #address 30
- display " ==> Return Status: PPP OK!"\n
- display "[Seq7 -- Your PPP connection into Crossroads is complete!]"\n
- display "[ExecSequence End.]"\n\n
- display ===========================================================\n\n
- display Please minimize this window and fire up your WinSock Apps.\n
- display For help, send email to: support@xroads.com\n\n
- display ===========================================================\n
- display \n\n
- #
- #DONE!